% TEST_ID: LANG-EXPAND-0023
% CATEGORY: language/array-ops/cat
% 测试

function test_cast_cat
    a = [true 3];
    assert_isequal(class(a), 'double')
    assert_isequal(a, [1 3]);

    b = [0; false];
    assert_isequal(class(b), 'double')
    assert_isequal(b, [0; 0]);

    c = false;
    c(2) = 3;
    assert_isequal(class(c), 'logical')
    assert_isequal(c, [false true]);

    s.a = 1;
    s.b = 2;
    e = [];
    assert(isequal([s, e], s));
    assert(isequal([logical(e), s], s));
    assert(isequal([s, {}], s));

    s = struct;
    b = {};
    assert(isequal([s b], s));
    assert(isequal([b s], s));
end


function assert_isequal(x, y)
    assert(isequal(x, y));
end